<?php
namespace controller;
require_once('model/login.php');
require_once('view/pageView.php');

class Control{
	
	//@var new \model\Login;
	private $model;
	//@var \view\PageView;
	private $view;
	//@var array
	private $array;
	
	public function __construct(){
		$this->model = new \model\Login();
		$this->view = new \view\PageView();
	}
	
	/*
	 * @return string (HTML)
	 */
	public function getHTML(){
		try {
			$this->array = $this->view->setArray();
			$message = $this->model->checkControl($this->array);
			$sessionLoggedIn = $this->model->checkIfLoggedIn();
			return $this->view->checkIfLoggedIn($message, $sessionLoggedIn);
		}catch(Exception $e){
			echo"Something wrong in controller";
		}
	}
}
 
